﻿<!DOCTYPE html>

<html class="js cssanimations">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>@ViewBag.Title</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <link rel="icon" type="image/png" href="/Source/assets/i/favicon.png">
    <script src="/Source/assets/js/jquery.min.js"></script>
    <script src="/Source/assets/js/amazeui.min.js"></script>
    <script src="/Source/assets/js/app.js"></script>

    <link rel="apple-touch-icon-precomposed" href="/Source/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI">
    <link rel="stylesheet" href="/Source/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="/Source/assets/css/admin.css">
</head>
<body>

    <header class="am-topbar admin-header">
        <div class="am-topbar-brand">
            <strong>软件协同办公系统(OA)</strong>
        </div>

        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

        <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

            <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">

                <li class="am-dropdown" data-am-dropdown="">
                    <a class="am-dropdown-toggle" data-am-dropdown-toggle="" href="javascript:;">
                        <span class="am-icon-users"></span>

                        @{
                            var info = Session["info"] as Model.OA_UserAccount;
                            var realName = string.Empty;
                            if (info != null)
                            {
                                var userBasic = BLL.EmployeeManager.GetUserBasic(info.Id);

                                if (userBasic != null)
                                {
                                    realName = userBasic.RealName;
                                }
                            } 
                        }

                        <span class="am-icon-caret-down"><b>@realName</b></span>
                    </a>
                    <ul class="am-dropdown-content">
                        <li><a href="#"><span class="am-icon-user"></span>资料</a></li>
                        <li><a href="#"><span class="am-icon-cog"></span>设置</a></li>
                        <li><a href="/Main/LoginOut"><span class="am-icon-power-off"></span>退出</a></li>
                    </ul>
                </li>
                <li><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span><span class="admin-fullText">开启全屏</span></a></li>
            </ul>
        </div>
    </header>

    <div class="am-cf admin-main">

        <div class="admin-sidebar">
            <ul class="am-list admin-sidebar-list">
                <li><a href="/Main/Index"><span class="am-icon-home"></span>首页</a></li>
                @{
                    //获取保存在session里面的用户账号信息
                    var info2 = Session["info"] as Model.OA_UserAccount;
                    if (info2 != null)
                    {
                        //根据当前用户ID查询当前用户所拥有的操作菜单集合
                        var parentMenuList = BLL.MenusManager.QueryListByUserId(info2.Id);
                        if (parentMenuList.Count != 0)
                        {
                            foreach (var item in parentMenuList)
                            {
                                if (item.IsParent)
                                { 
                    <li class="admin-parent">
                        <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"><span class="am-icon-file"></span>@item.Name <span class="am-icon-angle-right am-fr am-margin-right"></span></a>

                        <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav">
                            @{
                                    //根据父级ID查询该父级菜单下面有哪些子集菜单
                                    var childMenuList = BLL.MenusManager.QueryListByParentId(item.Id);
                                    if (childMenuList.Count != 0)
                                    {
                                        foreach (var c in childMenuList)
                                        { 
                                <li><a href="@c.Url"><span class="am-icon-puzzle-piece"></span>@c.Name</a></li> 
                                        }
                                    } 
                            }
                        </ul>

                    </li>
                                }
                            }
                        }
                    }
                }

                @* <li><a href="admin-index.html"><span class="am-icon-home"></span>首页</a></li>
                <li class="admin-parent">
                    <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"><span class="am-icon-file"></span>页面模块 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
                    <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav">
                        <li><a href="admin-user.html" class="am-cf"><span class="am-icon-check"></span>个人资料<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
                        <li><a href="admin-help.html"><span class="am-icon-puzzle-piece"></span>帮助页</a></li>
                        <li><a href="admin-gallery.html"><span class="am-icon-th"></span>相册页面<span class="am-badge am-badge-secondary am-margin-right am-fr">24</span></a></li>
                        <li><a href="admin-log.html"><span class="am-icon-calendar"></span>系统日志</a></li>
                        <li><a href="admin-404.html"><span class="am-icon-bug"></span>404</a></li>
                    </ul>
                </li>
                <li><a href="admin-table.html"><span class="am-icon-table"></span>表格</a></li>
                <li><a href="admin-form.html"><span class="am-icon-pencil-square-o"></span>表单</a></li>
                <li><a href="#"><span class="am-icon-sign-out"></span>注销</a></li>*@
            </ul>


        </div>
        <div class="admin-content">

            @* 分布页 *@
            @Html.Partial("/Views/PartialPage.cshtml")

            @* 布局页 *@
            @RenderBody()

        </div>
        <!-- content end -->

    </div>

    <footer>
        <hr>
        <p class="am-padding-left">© @DateTime.Now.ToString("yyyy") AllMobilize, Inc. Licensed under MIT license.</p>
    </footer>



</body>
</html>
